// calculate simple interest using C++ with classes

# include <iostream.h>
# include <conio.h>

class InterestCalc {

  float p, n, r;

public:

  void getDetails() {
    cout << "Enter principle: ";
    cin >> p;
    cout << "Enter rate of interest: ";
    cin >> r;
    cout << "Enter period: ";
    cin >> n;
  }

  void printInterest() {
    cout << "Interest is: " << (p*n*r/100);
  }

};

void main() {
  clrscr();
  InterestCalc interestCalc;
  interestCalc.getDetails();
  interestCalc.printInterest();
  getch();
}